$('#module').combobox({
    id: "module",
    url: webRoot + "/console/systemModules/field",
    onChange: function () {
        curEl.bootstrapTable("refresh");
    }
});

$("#add").on("click", function () {
    $.showPage("", "新增", webRoot + "/console/systemPermissions/add.html?parent=0");
});

var curEl = $("#systemPermissionsTable");
curEl.initTable({
    url: webRoot + '/console/systemPermissions',
    columns: systemPermissionColumns(),
    isPagination: true,
    extraParamsDom: {
        moduleId: $("#module")
    },
    buttons: [{
        id: "edit",
        btnClass: "btn btn-default btn-xs purple",
        icon: "fa fa-edit",
        name: "编辑",
        handler: function (row) {
            $.showPage("", "编辑", webRoot + "/console/systemPermissions/edit.html?id=" + row.id);
        }
    }]
});